package com.bing.bing.servi;

import com.bing.bing.mapper.MyMapper;
import com.bing.bing.pojo.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class DuoYuServiceImpl {

    @Autowired(required = false)
    MyMapper myMapper;

    @Autowired
    DuoyuService duoyuService;

    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
    public void addUser(String username) {
        saveUserName(username);

    }

    private void saveUserName(String username) {
        duoyuService.saveTest(username);
    }
}
